package com.lzh.shijicloudstack.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lzh.shijicloudstack.common.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * 菜谱食材表
 *
 * @author luzhiheng
 * @since 2024-12-28 16:14:28
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("cookbook_ingredient")
@Entity
@Table(name = "cookbook_ingredient", indexes = {
        @Index(name = "cookbook_id_idx", columnList = "cookbook_id", unique = false),
        @Index(name = "ingredient_id_idx", columnList = "ingredient_id", unique = false)
})
public class CookbookIngredient extends BaseEntity {

    /**
     * 菜谱ID
     */
    @Column(name = "cookbook_id", columnDefinition = "bigint(20) COMMENT '菜谱ID'")
    private Long cookbookId;

    /**
     * 食材ID
     */
    @Column(name = "ingredient_id", columnDefinition = "bigint(20) COMMENT '食材ID'")
    private Long ingredientId;

    /**
     * 食材用量
     */
    @Column(name = "ingredient_usage", columnDefinition = "varchar(255) COMMENT '食材用量'")
    private String ingredientUsage;

    /**
     * 备注
     */
    @Column(name = "remark", columnDefinition = "varchar(255) COMMENT '备注'")
    private String remark;

}
